package com.yixing.tech.common.base;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @author yixing tech
 * at 2022/4/8
 * describe：
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ConditionsVO extends BaseVO {
    private List<Condition> conditions;
    private String likeStr;
    private String attrCode;

    /**
     * 按时间稀疏
     */
    private SparesConfig sparesConfig;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class SparesConfig {
        /**
         * 分组的时间字段
         */
        private String timeAttrCode="valueTime";
        /**
         * 稀疏间隔，m:分钟，h:小时
         */
        private String type="m";

        /**
         * 其他分组字段
         */
        private List<String> groupAttrCode;
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Condition {
        private String key;
        /**
         *  @see com.yixing.tech.common.enums.ComparisonSymbol
         */
        private String symbol;
        private Object value;
    }

}
